#include "myobjectcreator.h"
#include "myboundary.h"
#include "mywindpoint.h"
#include "wheelchair.h"
#include <iostream>
using namespace std;

Boundary* myObjectCreator::CreateBoundary() const
{
    return new myBoundary;
}

Boundary* myObjectCreator::CreateWorldBoundary() const
{
    myBoundary* ptr = new myBoundary;
    return ptr;
}

Boundary* myObjectCreator::CreateBoundary(const Line& line)
{
    myBoundary* ptr = new myBoundary;
    ptr->SetLine(line);
    return ptr;
}

void myCollision::CollideMovingPointWithStaticLine(Collidable* movingPoint, Collidable* staticLine)
{
    Moveable* movingPointm = dynamic_cast<Moveable*>(movingPoint);
    Speed newSpeed = movingPointm->GetNewSpeed();
    newSpeed.SetMag(0);
    movingPointm->SetNewSpeed(newSpeed);
    movingPointm->ResetNewPosition();

    if(dynamic_cast<WheelChair*>(movingPoint))
        dynamic_cast<WheelChair*>(movingPoint)->SetBreak(100);
}

